/**
 * <copyright>
 * </copyright>
 *

 */
package org.xmdl.silk.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import org.xmdl.silk.Assignment;
import org.xmdl.silk.Atom;
import org.xmdl.silk.Expression;
import org.xmdl.silk.Factor;
import org.xmdl.silk.Invocation;
import org.xmdl.silk.Literal;
import org.xmdl.silk.Method;
import org.xmdl.silk.NumDouble;
import org.xmdl.silk.NumInteger;
import org.xmdl.silk.Operation;
import org.xmdl.silk.ParaGroup;
import org.xmdl.silk.PrintStatement;
import org.xmdl.silk.Program;
import org.xmdl.silk.ReturnStatement;
import org.xmdl.silk.SilkFactory;
import org.xmdl.silk.SilkPackage;
import org.xmdl.silk.Statement;
import org.xmdl.silk.ValueItem;
import org.xmdl.silk.Variable;
import org.xmdl.silk.VariableRef;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class SilkFactoryImpl extends EFactoryImpl implements SilkFactory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static SilkFactory init()
  {
    try
    {
      SilkFactory theSilkFactory = (SilkFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.xmdl.org/silk"); 
      if (theSilkFactory != null)
      {
        return theSilkFactory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new SilkFactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SilkFactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case SilkPackage.PROGRAM: return createProgram();
      case SilkPackage.METHOD: return createMethod();
      case SilkPackage.STATEMENT: return createStatement();
      case SilkPackage.ASSIGNMENT: return createAssignment();
      case SilkPackage.PRINT_STATEMENT: return createPrintStatement();
      case SilkPackage.INVOCATION: return createInvocation();
      case SilkPackage.RETURN_STATEMENT: return createReturnStatement();
      case SilkPackage.VARIABLE: return createVariable();
      case SilkPackage.VARIABLE_REF: return createVariableRef();
      case SilkPackage.EXPRESSION: return createExpression();
      case SilkPackage.ATOM: return createAtom();
      case SilkPackage.FACTOR: return createFactor();
      case SilkPackage.NUMBER: return createNumber();
      case SilkPackage.NUM_INTEGER: return createNumInteger();
      case SilkPackage.NUM_DOUBLE: return createNumDouble();
      case SilkPackage.PARA_GROUP: return createParaGroup();
      case SilkPackage.VALUE_ITEM: return createValueItem();
      case SilkPackage.LITERAL: return createLiteral();
      case SilkPackage.OPERATION: return createOperation();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Program createProgram()
  {
    ProgramImpl program = new ProgramImpl();
    return program;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Method createMethod()
  {
    MethodImpl method = new MethodImpl();
    return method;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Statement createStatement()
  {
    StatementImpl statement = new StatementImpl();
    return statement;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Assignment createAssignment()
  {
    AssignmentImpl assignment = new AssignmentImpl();
    return assignment;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public PrintStatement createPrintStatement()
  {
    PrintStatementImpl printStatement = new PrintStatementImpl();
    return printStatement;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Invocation createInvocation()
  {
    InvocationImpl invocation = new InvocationImpl();
    return invocation;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ReturnStatement createReturnStatement()
  {
    ReturnStatementImpl returnStatement = new ReturnStatementImpl();
    return returnStatement;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Variable createVariable()
  {
    VariableImpl variable = new VariableImpl();
    return variable;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public VariableRef createVariableRef()
  {
    VariableRefImpl variableRef = new VariableRefImpl();
    return variableRef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Expression createExpression()
  {
    ExpressionImpl expression = new ExpressionImpl();
    return expression;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Atom createAtom()
  {
    AtomImpl atom = new AtomImpl();
    return atom;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Factor createFactor()
  {
    FactorImpl factor = new FactorImpl();
    return factor;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public org.xmdl.silk.Number createNumber()
  {
    NumberImpl number = new NumberImpl();
    return number;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NumInteger createNumInteger()
  {
    NumIntegerImpl numInteger = new NumIntegerImpl();
    return numInteger;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NumDouble createNumDouble()
  {
    NumDoubleImpl numDouble = new NumDoubleImpl();
    return numDouble;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ParaGroup createParaGroup()
  {
    ParaGroupImpl paraGroup = new ParaGroupImpl();
    return paraGroup;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ValueItem createValueItem()
  {
    ValueItemImpl valueItem = new ValueItemImpl();
    return valueItem;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Literal createLiteral()
  {
    LiteralImpl literal = new LiteralImpl();
    return literal;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Operation createOperation()
  {
    OperationImpl operation = new OperationImpl();
    return operation;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SilkPackage getSilkPackage()
  {
    return (SilkPackage)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static SilkPackage getPackage()
  {
    return SilkPackage.eINSTANCE;
  }

} //SilkFactoryImpl
